package com.zf.yichat.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

@Table(name = "st_ticket_market")
public class StTicketMarket implements Serializable {

    // 已上架
    public static final Integer STATUS_LISTED = 0;
    // 已下架
    public static final Integer STATUS_REMOVED = 1;
    // 已出售
    public static final Integer STATUS_SOLD = 2;
    // 立即购买
    public static final Integer STATUS_BUY = 3;



    @Id
    private Integer id;

    @Column(name = "user_ticket_id")
    private Integer userTicketId;

    @Column(name = "user_id")
    private Long userId;

    @Column(name = "user_nick")
    private String userNick;

    @Column(name = "user_avatar")
    private String userAvatar;

    @Column(name = "ticket_title")
    private String ticketTitle;

    @Column(name = "ticket_price")
    private BigDecimal ticketPrice;

    /**
     * 0 已上架  1 已下架  2 已出售
     */
    private Integer status;

    @Column(name = "on_sale_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date onSaleTime;

    @Column(name = "off_sale_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date offSaleTime;

    @Column(name = "sold_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date soldTime;

    private static final long serialVersionUID = 1L;

    public StTicketMarket(Integer id, Integer userTicketId, Long userId, String userNick, String userAvatar, String ticketTitle, BigDecimal ticketPrice, Integer status, Date onSaleTime, Date offSaleTime, Date soldTime) {
        this.id = id;
        this.userTicketId = userTicketId;
        this.userId = userId;
        this.userNick = userNick;
        this.userAvatar = userAvatar;
        this.ticketTitle = ticketTitle;
        this.ticketPrice = ticketPrice;
        this.status = status;
        this.onSaleTime = onSaleTime;
        this.offSaleTime = offSaleTime;
        this.soldTime = soldTime;
    }

    public StTicketMarket() {
        super();
    }

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return user_ticket_id
     */
    public Integer getUserTicketId() {
        return userTicketId;
    }

    /**
     * @param userTicketId
     */
    public void setUserTicketId(Integer userTicketId) {
        this.userTicketId = userTicketId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * @return user_nick
     */
    public String getUserNick() {
        return userNick;
    }

    /**
     * @param userNick
     */
    public void setUserNick(String userNick) {
        this.userNick = userNick == null ? null : userNick.trim();
    }

    /**
     * @return user_avatar
     */
    public String getUserAvatar() {
        return userAvatar;
    }

    /**
     * @param userAvatar
     */
    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar == null ? null : userAvatar.trim();
    }

    /**
     * @return ticket_title
     */
    public String getTicketTitle() {
        return ticketTitle;
    }

    /**
     * @param ticketTitle
     */
    public void setTicketTitle(String ticketTitle) {
        this.ticketTitle = ticketTitle == null ? null : ticketTitle.trim();
    }

    public BigDecimal getTicketPrice() {
        return ticketPrice;
    }

    public void setTicketPrice(BigDecimal ticketPrice) {
        this.ticketPrice = ticketPrice;
    }

    /**
     * 获取0 已上架  1 已下架  2 已出售
     *
     * @return status - 0 已上架  1 已下架  2 已出售
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * 设置0 已上架  1 已下架  2 已出售
     *
     * @param status 0 已上架  1 已下架  2 已出售
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * @return on_sale_time
     */
    public Date getOnSaleTime() {
        return onSaleTime;
    }

    /**
     * @param onSaleTime
     */
    public void setOnSaleTime(Date onSaleTime) {
        this.onSaleTime = onSaleTime;
    }

    /**
     * @return off_sale_time
     */
    public Date getOffSaleTime() {
        return offSaleTime;
    }

    /**
     * @param offSaleTime
     */
    public void setOffSaleTime(Date offSaleTime) {
        this.offSaleTime = offSaleTime;
    }

    /**
     * @return sold_time
     */
    public Date getSoldTime() {
        return soldTime;
    }

    /**
     * @param soldTime
     */
    public void setSoldTime(Date soldTime) {
        this.soldTime = soldTime;
    }
}